home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / PInterfaces / Dialogs.p < prev    next >
Encoding:
Text File  |  1989-10-13  |  4.5 KB  |  188 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Tuesday, August 2, 1988 at 6:00 AM
  3.     Dialogs.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.     1985-1988
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Dialogs;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingDialogs}
  21. {$SETC UsingDialogs := 1}
  22.  
  23. {$I+}
  24. {$SETC DialogsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingWindows}
  27. {$I $$Shell(PInterfaces)Windows.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingTextEdit}
  30. {$I $$Shell(PInterfaces)TextEdit.p}
  31. {$ENDC}
  32. {$SETC UsingIncludes := DialogsIncludes}
  33.  
  34. CONST
  35. ctrlItem = 4;
  36. btnCtrl = 0;
  37. chkCtrl = 1;
  38. radCtrl = 2;
  39. resCtrl = 3;
  40. statText = 8;
  41. editText = 16;
  42. iconItem = 32;
  43. picItem = 64;
  44. userItem = 0;
  45. itemDisable = 128;
  46. ok = 1;
  47. cancel = 2;
  48. stopIcon = 0;
  49. noteIcon = 1;
  50. cautionIcon = 2;
  51.  
  52.  
  53. TYPE
  54.  
  55.  
  56. DialogPeek = ^DialogRecord;
  57. DialogRecord = RECORD
  58.     window: WindowRecord;
  59.     items: Handle;
  60.     textH: TEHandle;
  61.     editField: INTEGER;
  62.     editOpen: INTEGER;
  63.     aDefItem: INTEGER;
  64.     END;
  65.  
  66. DialogPtr = WindowPtr;
  67.  
  68. DialogTPtr = ^DialogTemplate;
  69. DialogTHndl = ^DialogTPtr;
  70. DialogTemplate = RECORD
  71.     boundsRect: Rect;
  72.     procID: INTEGER;
  73.     visible: BOOLEAN;
  74.     filler1: BOOLEAN;
  75.     goAwayFlag: BOOLEAN;
  76.     filler2: BOOLEAN;
  77.     refCon: LONGINT;
  78.     itemsID: INTEGER;
  79.     title: Str255;
  80.     END;
  81.  
  82. StageList = PACKED RECORD
  83.     boldItm4: 0..1;     {default button item number - 1}
  84.     boxDrwn4: BOOLEAN;    {true if alert box to be drawn}
  85.     sound4: 0..3;        {sound number}
  86.     boldItm3: 0..1;
  87.     boxDrwn3: BOOLEAN;
  88.     sound3: 0..3;
  89.     boldItm2: 0..1;
  90.     boxDrwn2: BOOLEAN;
  91.     sound2: 0..3;
  92.     boldItm1: 0..1;
  93.     boxDrwn1: BOOLEAN;
  94.     sound1: 0..3;
  95.     END;
  96.  
  97. AlertTPtr = ^AlertTemplate;
  98. AlertTHndl = ^AlertTPtr;
  99. AlertTemplate = RECORD
  100.     boundsRect: Rect;
  101.     itemsID: INTEGER;
  102.     stages: StageList;
  103.     END;
  104.  
  105.  
  106.  
  107. PROCEDURE InitDialogs(resumeProc: ProcPtr);
  108.     INLINE $A97B;
  109. PROCEDURE ErrorSound(soundProc: ProcPtr);
  110.     INLINE $A98C;
  111. FUNCTION NewDialog(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  112.     procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT;
  113.     itmLstHndl: Handle): DialogPtr;
  114.     INLINE $A97D;
  115. FUNCTION GetNewDialog(dialogID: INTEGER;dStorage: Ptr;behind: WindowPtr): DialogPtr;
  116.     INLINE $A97C;
  117. PROCEDURE CloseDialog(theDialog: DialogPtr);
  118.     INLINE $A982;
  119. PROCEDURE DisposDialog(theDialog: DialogPtr);
  120.     INLINE $A983;
  121. PROCEDURE CouldDialog(dialogID: INTEGER);
  122.     INLINE $A979;
  123. PROCEDURE FreeDialog(dialogID: INTEGER);
  124.     INLINE $A97A;
  125. PROCEDURE ParamText(param0: Str255;param1: Str255;param2: Str255;param3: Str255);
  126.     INLINE $A98B;
  127. PROCEDURE ModalDialog(filterProc: ProcPtr;VAR itemHit: INTEGER);
  128.     INLINE $A991;
  129. FUNCTION IsDialogEvent(theEvent: EventRecord): BOOLEAN;
  130.     INLINE $A97F;
  131. FUNCTION DialogSelect(theEvent: EventRecord;VAR theDialog: DialogPtr;VAR itemHit: INTEGER): BOOLEAN;
  132.     INLINE $A980;
  133. PROCEDURE DrawDialog(theDialog: DialogPtr);
  134.     INLINE $A981;
  135. PROCEDURE UpdtDialog(theDialog: DialogPtr;updateRgn: RgnHandle);
  136.     INLINE $A978;
  137. FUNCTION Alert(alertID: INTEGER;filterProc: ProcPtr): INTEGER;
  138.     INLINE $A985;
  139. FUNCTION StopAlert(alertID: INTEGER;filterProc: ProcPtr): INTEGER;
  140.     INLINE $A986;
  141. FUNCTION NoteAlert(alertID: INTEGER;filterProc: ProcPtr): INTEGER;
  142.     INLINE $A987;
  143. FUNCTION CautionAlert(alertID: INTEGER;filterProc: ProcPtr): INTEGER;
  144.     INLINE $A988;
  145. PROCEDURE CouldAlert(alertID: INTEGER);
  146.     INLINE $A989;
  147. PROCEDURE FreeAlert(alertID: INTEGER);
  148.     INLINE $A98A;
  149. PROCEDURE GetDItem(theDialog: DialogPtr;itemNo: INTEGER;VAR itemType: INTEGER;
  150.     VAR item: Handle;VAR box: Rect);
  151.     INLINE $A98D;
  152. PROCEDURE SetDItem(theDialog: DialogPtr;itemNo: INTEGER;itemType: INTEGER;
  153.     item: Handle;box: Rect);
  154.     INLINE $A98E;
  155. PROCEDURE HideDItem(theDialog: DialogPtr;itemNo: INTEGER);
  156.     INLINE $A827;
  157. PROCEDURE ShowDItem(theDialog: DialogPtr;itemNo: INTEGER);
  158.     INLINE $A828;
  159. PROCEDURE SelIText(theDialog: DialogPtr;itemNo: INTEGER;strtSel: INTEGER;
  160.     endSel: INTEGER);
  161.     INLINE $A97E;
  162. PROCEDURE GetIText(item: Handle;VAR text: Str255);
  163.     INLINE $A990;
  164. PROCEDURE SetIText(item: Handle;text: Str255);
  165.     INLINE $A98F;
  166. FUNCTION FindDItem(theDialog: DialogPtr;thePt: Point): INTEGER;
  167.     INLINE $A984;
  168. FUNCTION NewCDialog(dStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  169.     procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT;
  170.     items: Handle): DialogPtr;
  171.     INLINE $AA4B;
  172. FUNCTION GetAlrtStage: INTEGER;
  173.     INLINE $3EB8,$0A9A;
  174. PROCEDURE ResetAlrtStage;
  175.     INLINE $4278,$0A9A;
  176. PROCEDURE DlgCut(theDialog: DialogPtr);
  177. PROCEDURE DlgPaste(theDialog: DialogPtr);
  178. PROCEDURE DlgCopy(theDialog: DialogPtr);
  179. PROCEDURE DlgDelete(theDialog: DialogPtr);
  180. PROCEDURE SetDAFont(fontNum: INTEGER);
  181.  
  182. {$ENDC}    { UsingDialogs }
  183.  
  184. {$IFC NOT UsingIncludes}
  185.     END.
  186. {$ENDC}
  187.  
  188.